/**
 * 
 */
package trungsi.gea.photos.domain;

import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Unique;

/**
 * @author trungsi
 *
 */
@PersistenceCapable
public class Folder implements Entity {
	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
	private String id;
	@Persistent
	@Unique(name="FOLDER_NAME_IDX")
	private String name;
	@Persistent
	private Date createdDate = new Date();
	//@Persistent(mappedBy="folder")
	//private List<Photo> photos = new ArrayList<Photo>();
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	/*public List<Photo> getPhotos() {
		return photos;
	}

	public void setPhotos(List<Photo> photos) {
		this.photos = photos;
	}*/

	public String getId() {
		return id;
	}

	/*public void removePhoto(Photo photo) {
		this.photos.remove(photo);
	}

	public void addPhoto(Photo photo) {
		this.photos.add(photo);
	}*/
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "folder[id=" + id + ",name=" + name + "]";
	}
}
